<template>
	<div>
		<section>
			<el-table class='f-12' ref='multipleTable' :data='dataList'>
				<el-table-column label='余额所属' align='left'>
					<template slot-scope='scope'>{{ scope.row.affiliation }}</template>
				</el-table-column>
				<el-table-column label='余额' align='left'>
					<template slot-scope='scope'>{{ scope.row.amount}}</template>
				</el-table-column>
			</el-table>
			
			<div class='m-t-30'>
				<pagination ref='pagination' :query='pageQuery' v-on:page='dataList = $event' url='user/getUserBalance'></pagination>
			</div>
			
		</section>
		
	</div>
</template>

<script>
	import pagination from '@/components/pagination.vue'

	export default {
		data () {
			return {
				filter : {
					key : '',
					userId : 0
				}, 
				
				pageQuery : {
					userId : 0
				},
				
				dataList : []
			}
		},
		
		components : {
			pagination
		},
		
		methods : {
			search : function(){
				let filter = Object.assign({}, this.filter)
				
				this.pageQuery = Object.assign({}, filter)
				
				this.$nextTick(() => {
					this.$refs.pagination.initPage()
				})
	
			}
		},
		
		created () {
			let userId = this.$route.params.userId
			this.filter.userId = userId
			this.pageQuery.userId = userId
		}
	}
</script>